import socket
import time
import struct

DST_IP = "192.168.1.114"
DST_PORT = 8888
# 建立Socket，SOCK_DGRAM表示Socket类型为UDP
print("Starting socket: UDP...")
socket_udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# 向目的地址和端口，发送数据
print("Sending package to %s:%d..." % (DST_IP, DST_PORT))
dst_addr = (DST_IP, DST_PORT)



value=(1,1,10,10,10)
packer = struct.Struct('bhhhh')
packed_data = packer.pack(*value)



def sentRobotMotion(data):
    socket_udp.sendto(data, dst_addr)

if __name__ =='__main__':
    while True:
        sentRobotMotion(packed_data)
        time.sleep(1)
        continue